<?php  if (!isset($_SESSION['login']) or !isset($_SESSION['senha'])) {
 	header('location: login.html');
 	  } 
 	  if($_SESSION['permissao'] === '1' || $_SESSION['permissao'] === '3'){
 	   	 header('location: index.php');
 	   }
 	  ?>

  	<form action="ferramenta/controlecadastro.php" method="POST">
	 	<fieldset id="formulario" class="field">
			<legend>Cadastro de Ferramentas</legend>
				
					
						<label for="desc">Nome da Ferramenta:</label>
						<td><input type="text" name="descricao" id="desc" /></br>
			        			        
				        <label for="fab">Nome do Fabricante:</label>
				        <input type="text" name="nofabricante" id="fab" /></br>
			     
				        <label for="categ">Número da Categoria:</label>
				        <select name="idcategoria" id="categ">
				        	<?php include 'conexao/conexao.php';
				        	$sql = "SELECT * FROM categoria_ferramenta";
				        	$result = mysql_query($sql);
				        	$arResult = mysql_fetch_assoc($result);
				        	do{?>
				        	<option value="<?php echo $arResult['idcategoria']; ?>"> <?php echo $arResult['nome_categoria']; ?></option>
				        	<?php }while($arResult = mysql_fetch_assoc($result))?>
				        </select></br>
				 		<input type="reset"  value="Limpar">
				 		<input type="submit" value="Salvar">
			    		
			</fieldset>
	</form>